package com.acme.bankapp.domain.bank;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

/**
 * @author Artem Kalchenko
 *
 */
public class Client {
	private String name;
	private Gender gender;
	private List<Account> accounts = new ArrayList<Account>();

	public Client(final String name, final Gender gender) {
		this.name = name;
		this.gender = gender;
	}

	public Client(final String name, final Gender gender, final Account account) {
		this.name = name;
		this.gender = gender;
		this.accounts.add(account);
	}

	public String getName() {
		return name;
	}
	
	public Gender getGender() {
		return gender;
	}

	public String getClientSalutation() {
		return gender.getSalutation() + " " + name;
	}

	public Account getAccount() {
		return accounts.get(0);
	}

	public void addAccount(final Account account) {
		accounts.add(account);
	}

	public List<Account> getAccounts() {
		return Collections.unmodifiableList(accounts);
	}
}
